/*
 * @Author: c
 * @Date: 2024-02-07 00:23:33
 * @LastEditTime: 2024-03-28 05:49:37
 * @LastEditors: c
 * @Description: 
 * @FilePath: \music-web-backend\src\core\music\track\dto\search-tracklist.dto.ts
 * https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
// Copyright 2024 Administrator
// 
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// 
//     http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import { Transform } from "class-transformer";
import { IsNumber, IsOptional, IsString } from "class-validator";
import { PageDto } from "src/common/dto/page.dto";
import { Pic } from "../../album/dto/create-album.dto";
import { SongDto } from "../../song/dto/search-song.dto";

export class TrackInfoDto {

    //唯一ID
    id: number;

    //背景图
    pic: Pic;

    //歌单的标题
    title: string;

    //歌单的描述
    desc: string;

    //歌单中歌曲列表
    songList: SongDto[];

    //歌单中歌曲总数
    trackCount: number;
    //当前登录用户是否喜欢
    isFavorite: boolean = false;
    //标签id列表
    cateList: number[];
    //标签文本列表
    tagList: string[];

    //资源类型（1）
    resourceType: number;
    menu: any[];
    _score: number
}
export class ReCommendTrackInfoDto extends TrackInfoDto {
    recommendSort: number;
}

export class TrackPageQuery extends PageDto {

    @IsOptional()
    @IsString()
    trackName: string
    @IsOptional()
    @Transform(v => +v)
    @IsNumber({ allowNaN: false }, { message: "歌手id必须是数字" })
    tagId?: number
}